<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <style type="text/css" media="screen">
        @import url("<c:url value="/resources/dojo/resources/dojo.css"/>");
        @import url("<c:url value="/resources/dijit/themes/tundra/tundra.css"/>");
        @import url("<c:url value="/static/styles/finance.css"/>");
    </style>

    <script djconfig="parseOnLoad: true" src="<c:url value="/resources/dojo/dojo.js"/>" type="text/javascript"></script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"></script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"></script>
    <script type="text/javascript">dojo.require("dojo.parser");</script>
    <title>Spring Finance</title>

</head>

<body class="tundra spring">

<div id="wrap">

    <div id="menu">
        <%@ include file="/WEB-INF/jsp/menu.jsp" %>
    </div>
    <div id="main">
        <div id="body">


            <script type="text/javascript">dojo.require("dijit.TitlePane");</script>
            <div dojoType="dijit.TitlePane" style="width: 100%" title="Show Product">
                <c:if test="${not empty product}">
                    <div>
                        <label for="name">Name:</label>

                        <div id="name">${product.name}</div>
                    </div>
                    <br/>

                    <div>
                        <label for="type">Type:</label>

                        <div id="type">${product.class.simpleName}</div>
                    </div>
                    <br/>

                    <div>
                        <label for="description">Description:</label>

                        <div id="description">${product.description}</div>
                    </div>
                    <br/>

                    <div>
                        <label for="managementFee">Management Fee:</label>

                        <div id="managementFee">${product.managementFee}</div>
                    </div>
                    <br/>
                    <c:if test="${product.class.simpleName eq 'ManagedFund'}">
                        <div>
                            <label for="fundId">Fund Id:</label>

                            <div id="fundId">${product.fundId}</div>
                        </div>
                        <br/>

                        <div>
                            <label for="distribution">Distribution:</label>

                            <div id="distribution">${product.distribution}</div>
                        </div>
                        <br/>

                        <div>
                            <label for="currentUnitPrice">Current Unit Price:</label>

                            <div id="currentUnitPrice">${product.currentUnitPrice}</div>
                        </div>
                        <br/>
                    </c:if>
                    <c:if test="${product.class.simpleName eq 'Cash'}">
                        <div>
                            <label for="interest">Interest:</label>

                            <div id="interest">${product.interest}</div>
                        </div>
                        <br/>
                    </c:if>
                    <c:if test="${product.class.simpleName eq 'Loan'}">
                        <div>
                            <label for="interest">Interest:</label>

                            <div id="interest">${product.interest}</div>
                        </div>
                        <br/>

                        <div>
                            <label for="principal">Principal:</label>

                            <div id="principal">${product.principal}</div>
                        </div>
                        <br/>

                        <div>
                            <label for="lenders">Lenders:</label>

                            <div id="lenders">${product.lenders}</div>
                        </div>
                        <br/>
                    </c:if>
                </c:if>
                <c:if test="${empty product}">No product found with this id.</c:if>
            </div>
        </div>
        <table class="footer">
            <tr>
                <td><a href="<c:url value="/" />">Home</a></td>
                <td align="right"><a href="http://stsmedia.net" alt="StSMedia.net">StSMedia.net</a></td>
            </tr>
        </table>

    </div>
</div>
</body>

</html>